package part15_中介者模式_智能家居;

/**  同事类(一个抽象类)
 * @ClassName: Colleague
 * @Author: AllenSun
 * @Date: 2020/3/8 22:13
 */
public abstract class Colleague {

    public String name;
    //中介者抽象类，注册，发出消息，接收消息
    private Mediator mediator;

    /**构造器
     * @MethodName: Colleague
     * @Author: AllenSun
     * @Date: 2020/3/8 22:20
     */
    public Colleague(String name, Mediator mediator) {
        this.name = name;
        this.mediator = mediator;
    }

    /**获取当前使用的中介者
     * @MethodName: GetMediator
     * @Author: AllenSun
     * @Date: 2020/3/8 22:21
     */
    public Mediator GetMediator(){
        return this.mediator;
    }

    /**发出消息
     * @MethodName: SendMessage
     * @Author: AllenSun
     * @Date: 2020/3/8 22:22
     */
    public abstract void SendMessage(int stateChange);
}
